package com.example.demo.readController;

import com.alibaba.excel.EasyExcel;
import com.example.demo.Listener.RepositoriesDataListener;
import com.example.demo.Listener.RepositoriesDataListener2;
import com.example.demo.Listener.RepositoriesDataListener3;
import com.example.demo.Listener.RepositoriesDataListener4;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.File;
@RestController
public class EasyRead {
    /**
     * 储值卡账户信息
     * @return
     */
    @GetMapping( "/kuFang")
    public void importKuFang() {
       // String fileName = panfu + ":/kufang.xlsx";
        File file=new File("D:\\莱西有利数据\\储值卡账户信息.xlsx");
        // 这里 只要，然后读取第一个sheet 同步读取会自动finish
        EasyExcel.read(file, new RepositoriesDataListener()).sheet().doRead();
    }
    @GetMapping("/shijian")
    public void importShiJian(){
        File file=new File("D:\\莱西有利数据\\储值卡账户信息.xlsx");
        EasyExcel.read(file, new RepositoriesDataListener2()).sheet().doRead();
    }
    @GetMapping("huiyuan")
    public void importHuiYuan(){
        File file=new File("D:\\莱西有利数据\\会员信息查询.xlsx");
        EasyExcel.read(file, new RepositoriesDataListener3()).sheet().doRead();
    }
    @GetMapping("ye")
    public void importye(){
        File file=new File("D:\\莱西有利数据\\储值卡账户信息.xlsx");
        EasyExcel.read(file, new RepositoriesDataListener4()).sheet().doRead();
    }
}
